﻿using System;
using System.Collections.Generic; 
using NTTDATA.BEENChina.ResultCertification.Config; 

namespace NTTDATA.BEENChina.ResultCertification.Checker.Select
{
   
    /// <summary>
    /// 文字栏＿未修正
    /// </summary>
    [Serializable]
    [VerfityAttribute(Id = "VerfityS0201", Name = "文字栏内容为一个[？]的结果抽出", CategoryType = EnumCategoryType.选择, Model = true)]
    public class VerfityS0201 : VerfityOneResult
    {

      

        public override bool CheckResult(List<List<string>> result, string entryCommon)
        {
            bool bresult = false;

            if (entryCommon == "30"  )
            {
                return false;
            }

            if (result == null)
            {
                return false;
            }


            bresult = CheckSpecificCharacter(result, GetSpeicficResult, CheckspecificResult); 

           

            if (bresult)
            {
                System.Console.WriteLine("VerfityS0201");
            }

            return bresult;
        }


        private string GetSpeicficResult(string colResult)
        {
            var splitResult = new Split.SplitEntryResult(ChildImageObject.CategorySetting.DataFormat, colResult);
            if (ChildImageObject.CategorySetting.DataFormat.Contains("tx"))
            {
                return splitResult.GetText();
            }
            

            return colResult;
        }


      
        private bool CheckspecificResult(string result)
        {
            bool bresult = false;  

            if (!String.IsNullOrEmpty(result))
            {
                bresult = result.Equals("?");

            }
            return bresult;
        }


    }
}
